package znbkTestPaperRdtz.saveRdtzPaper;

import com.example.lancooznbk.service.HttpPostServer;
import com.lancoo.rxretrofitlibrary.Api.BaseApi;
import com.lancoo.rxretrofitlibrary.Api.UserInfo;
import com.lancoo.rxretrofitlibrary.listener.HttpOnNextListener;
import com.trello.rxlifecycle.components.support.RxAppCompatActivity;

import retrofit2.Retrofit;
import rx.Observable;
import znbkTestPaperRdtz.ZnbkPaperRdtzInfor;


/**
 * Created by Administrator on 2018\4\24 0024.
 */

public class SaveHeatPointExtensionPaperApi extends BaseApi {

    private  SaveHeatPointExtensionPaperEntity  mSaveHeatPointExtensionPaperEntity;

    public SaveHeatPointExtensionPaperEntity getmSaveHeatPointExtensionPaperEntity() {
        return mSaveHeatPointExtensionPaperEntity;
    }

    public void setmSaveHeatPointExtensionPaperEntity(SaveHeatPointExtensionPaperEntity mSaveHeatPointExtensionPaperEntity) {
        this.mSaveHeatPointExtensionPaperEntity = mSaveHeatPointExtensionPaperEntity;
    }


    public SaveHeatPointExtensionPaperApi(HttpOnNextListener listener, RxAppCompatActivity rxAppCompatActivity) {
        super(listener, rxAppCompatActivity);
    }

    @Override
    public Observable getObservable(Retrofit retrofit) {
        PostServer postServer = retrofit.create(PostServer.class);
//        SaveHeatPointExtensionPaperEntity.ResModelBean resModelBean =
//                new SaveHeatPointExtensionPaperEntity.ResModelBean(ZnbkPaperRdtzInfor.CreatTime, UserInfo.SubjectId,
//                        ZnbkPaperRdtzInfor.HotType,ZnbkPaperRdtzInfor.ResID,ZnbkPaperRdtzInfor.ResType,ZnbkPaperRdtzInfor.Title,
//                        UserInfo.StageNo,UserInfo.StuId,ZnbkPaperRdtzInfor.RecommendNumberOfTimes);
//
//        String ZSDCodeAll = "";
//
//        for(int i=0;i<mEntityRdtz.getResFromTK().getImportantZSD().size();i++){
//            if(i==0){
//                ZSDCodeAll = mEntityRdtz.getResFromTK().getImportantZSD().get(0).getZSDCode();
//            }else{
//                ZSDCodeAll = ZSDCodeAll+"|"+mEntityRdtz.getResFromTK().getImportantZSD().get(i).getZSDCode();
//            }
//        }
//        SaveHeatPointExtensionPaperEntity.ResPostBean resPostBean =
//                new SaveHeatPointExtensionPaperEntity.ResPostBean(ZnbkPaperRdtzInfor.ResID,ZnbkPaperRdtzInfor.ResType,2,
//                        UserInfo.StuId,UserInfo.SubjectId,ZSDCodeAll);
//
//        SaveHeatPointExtensionPaperEntity saveHeatPointExtensionPaperEntity = new SaveHeatPointExtensionPaperEntity();
//        saveHeatPointExtensionPaperEntity.SaveHeatPointExtensionPaperEntity("",resModelBean,UserInfo.SchoolId,resPostBean,
//                ZnbkPaperRdtzInfor.Flag);

        return postServer.saveResAndQues(mSaveHeatPointExtensionPaperEntity);
    }
}